/**
 * @author eric.schulte
 */
class com.mrmny.util.string.StrReplace {
	
	
	//this is a better way of doing things
	public static function Replace($str:String, oldChar:String, newChar:String):String{
		var processedText:String = $str;
		var subStringPos:Number = 0;
		do {
			subStringPos = processedText.indexOf(oldChar, subStringPos);
			if (subStringPos>-1) {
				processedText = String(processedText.slice(0, subStringPos)+newChar+processedText.slice(subStringPos+oldChar.length));
				subStringPos = subStringPos+(newChar.length+1);
			}
		} while (subStringPos>-1);
		return processedText;
	}
	
	
	
}